package com.dzl.userwx;

import com.dzl.base.controller.BaseController;
import com.dzl.userwx.pojo.query.WelfareUserWxIntegralQuery;
import com.dzl.userwx.pojo.vo.WelfareUserOrganizationVo;
import com.dzl.userwx.service.WelfareUserWxService;
import com.dzl.util.PageUtils;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author chenlong
 * @description: saas服务端组织架构成员(用户)相关
 * @since 12:41 2021/09/06
 */
@RestController
@RequestMapping("/welfareUser")
public class WelfareUserController extends BaseController {

    @Autowired
    private WelfareUserWxService service;

    /**
     * 查询成员积分管理分页数据
     * @date 2021/9/8 10:30
     * @author caobucao
     * @param query 搜索条件
     * @return com.dzl.util.PageUtils<com.dzl.userwx.pojo.vo.WelfareUserWxIntegralVo>
     */
    @GetMapping("/getUserWxIntegralPage")
    public PageUtils<WelfareUserOrganizationVo> getUserWxIntegralPage(WelfareUserWxIntegralQuery query) {
        query.setEnterpriseId(getAdminInfo().getEnterpriseId());
        List<WelfareUserOrganizationVo> list = service.getUserWxIntegralPage(query);
        PageInfo<WelfareUserOrganizationVo> pageInfo = new PageInfo<>(list);
        return new PageUtils<>(pageInfo);
    }

}
